package com.dxp.operation.vo.respose.base;


import com.dxp.operation.exception.ErrEnum;

/**
 * @author carzy
 */
public class ErrorResult<T> extends Result<T> {

    public static <T> ErrorResult<T> of(ErrEnum errEnum, T data) {
        ErrorResult<T> result = of(errEnum);
        result.setData(data);
        return result;
    }

    public static <T> ErrorResult<T> of(ErrEnum errEnum) {
        ErrorResult<T> result = new ErrorResult<>();
        result.setError(errEnum.code());
        result.setMsg(errEnum.msg());
        return result;
    }
}
